all: build/ts build/tc build/us build/uc build/tds build/tdc

build/tcp: build/ts build/tc

build/udp: build/us build/uc

build/duplex: build/tds build/tdc

build/ts: build tcp_server.cpp net.h
	gcc -o build/ts tcp_server.cpp

build/tc: build tcp_client.cpp net.h
	gcc -o build/tc tcp_client.cpp

build/us: build udp_server.cpp net.h
	gcc -o build/us udp_server.cpp

build/uc: build udp_client.cpp net.h
	gcc -o build/uc udp_client.cpp

build/tds: build tcp_duplex_server.cpp net.h
	gcc -o build/tds tcp_duplex_server.cpp

build/tdc: build tcp_duplex_client.cpp net.h
	gcc -o build/tdc tcp_duplex_client.cpp

build:
	mkdir -p build

clean:
	rm -r build

.PHONY: clean